// 模拟API延迟
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms))

// 请求封装
export const request = async (action, delayTime = 500) => {
  try {
    await delay(delayTime)
    const result = await action()
    return result
  } catch (error) {
    console.error('API Error:', error)
    return Promise.reject(error)
  }
} 